Method A:
ActionContext.getContext().getSession() (returns Map, works internally using a ThreadLocal)
Method B (Recommended):
Have the action implements SessionAware, and the Session (as a Map) will be set through the setSession(Map) method. This requires that the 'servlet-config' interceptor being included when the particular action is processed.
@see webwork-default.xml
@see com.opensymphony.webwork.interceptor.SessionAware
@see com.opensymphony.webwork.interceptor.Servlet Config Interceptor
|